package com.ruoyi.common.base.user.mapstruct;

import com.ruoyi.common.base.user.domain.User;
import com.ruoyi.common.base.user.vo.UserLoginRes;
import com.ruoyi.common.base.user.vo.UserToken;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * ChatStruct
 *
 * @author gdk
 * @version 1.0.0
 * @since 2022/2/8 3:04
 */
@Mapper
public interface UserStruct {
    UserStruct INSTANCE = Mappers.getMapper(UserStruct.class);

    /**
     * User -> UserToken
     *
     * @param user 实体类
     * @return {@link UserToken}
     * @author gdk
     * @since 2022/2/8
     */
    UserToken entity2Token(User user);

    /**
     * UserToken -> UserLoginRes
     *
     * @param token token
     * @return {@link UserLoginRes}
     * @author gdk
     * @since 2022/2/8
     */
    UserLoginRes token2LoginRes(UserToken token);
}
